module.exports = app =>{
    const mongoose = require('mongoose');
    mongoose.connect('mongodb://localhost:27017/my_blog', {useNewUrlParser: true, useUnifiedTopology: true});
    //查询连接状态
    const db = mongoose.connection;
    db.on('error', console.error.bind(console, 'connection error:'));
    db.once('open', function () {
        // we're connected!
        console.log("连接成功");
    });
}
